home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1996-10-01 | 10.5 KB | [TEXT/CWIE] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Tue Oct 1 19:52:27 1996, modified Tue Oct 1 19:52:27 1996, creator 'CWIE', type ASCII, 10088 bytes "ShapeMeasurement.c" , at 0x27e8 410 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [CWIE] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 12 53 68 61 70 65 4d | 65 61 73 75 72 65 6d 65 |..ShapeM|easureme|
|00000010| 6e 74 2e 63 00 00 00 00 | 00 00 00 00 00 00 00 00 |nt.c....|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 27 68 00 | 00 01 9a ae 77 5f 3b ae |.....'h.|....w_;.|
|00000060| 77 5f 3b 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |w_;.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 e4 ba 00 00 |........|........|
|00000080| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00000090| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 0d 0d 0d 09 46 |********|***....F|
|000000c0| 69 6c 65 3a 20 53 68 61 | 70 65 4d 65 61 73 75 72 |ile: Sha|peMeasur|
|000000d0| 65 6d 65 6e 74 2e 63 0d | 09 0d 09 54 68 69 73 20 |ement.c.|...This |
|000000e0| 66 69 6c 65 20 63 6f 6e | 74 61 69 6e 73 20 75 74 |file con|tains ut|
|000000f0| 69 6c 69 74 69 65 73 20 | 74 68 61 74 20 63 61 6e |ilities |that can|
|00000100| 20 6d 6f 72 65 20 61 63 | 63 75 72 61 74 65 6c 79 | more ac|curately|
|00000110| 20 6d 65 61 73 75 72 65 | 0d 09 73 68 61 70 65 73 | measure|..shapes|
|00000120| 20 74 68 61 6e 20 74 68 | 65 20 66 75 6e 63 74 69 | than th|e functi|
|00000130| 6f 6e 73 20 62 75 69 6c | 74 20 69 6e 74 6f 20 51 |ons buil|t into Q|
|00000140| 75 69 63 6b 44 72 61 77 | 20 47 58 2e 20 20 57 68 |uickDraw| GX. Wh|
|00000150| 69 6c 65 20 74 68 65 0d | 09 66 75 6e 63 74 69 6f |ile the.|.functio|
|00000160| 6e 73 20 69 6e 20 47 58 | 20 61 72 65 20 61 63 63 |ns in GX| are acc|
|00000170| 75 72 61 74 65 20 65 6e | 6f 75 67 68 20 66 6f 72 |urate en|ough for|
|00000180| 20 64 6f 69 6e 67 20 6e | 6f 72 6d 61 6c 20 64 61 | doing n|ormal da|
|00000190| 73 68 69 6e 67 20 6f 66 | 0d 09 73 68 61 70 65 73 |shing of|..shapes|
|000001a0| 2c 20 74 68 65 20 73 6c | 69 67 68 74 20 65 72 72 |, the sl|ight err|
|000001b0| 6f 72 73 20 61 72 65 20 | 76 69 73 75 61 6c 6c 79 |ors are |visually|
|000001c0| 20 6f 62 76 69 6f 75 73 | 20 77 68 65 6e 20 75 73 | obvious| when us|
|000001d0| 69 6e 67 20 74 68 65 6d | 0d 09 66 6f 72 20 74 65 |ing them|..for te|
|000001e0| 78 74 20 70 6f 73 69 74 | 69 6f 6e 69 6e 67 2e 20 |xt posit|ioning. |
|000001f0| 0d 09 0d 09 4d 75 63 68 | 20 74 68 61 6e 6b 73 20 |....Much| thanks |
|00000200| 74 6f 20 4a 6f 73 65 70 | 68 20 4d 61 75 72 65 72 |to Josep|h Maurer|
|00000210| 20 66 6f 72 20 69 6d 70 | 6c 65 6d 65 6e 74 69 6e | for imp|lementin|
|00000220| 67 20 74 68 65 20 68 61 | 72 64 2d 63 6f 72 65 0d |g the ha|rd-core.|
|00000230| 09 6d 61 74 68 20 70 61 | 72 74 20 6f 66 20 74 68 |.math pa|rt of th|
|00000240| 69 73 2e 0d 0d 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |is...***|********|
|00000250| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000260| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000270| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000280| 2a 2f 0d 0d 0d 0d 0d 23 | 69 6e 63 6c 75 64 65 20 |*/.....#|include |
|00000290| 22 54 79 70 65 73 2e 68 | 22 0d 23 69 6e 63 6c 75 |"Types.h|".#inclu|
|000002a0| 64 65 20 22 47 58 54 79 | 70 65 73 2e 68 22 0d 23 |de "GXTy|pes.h".#|
|000002b0| 69 6e 63 6c 75 64 65 20 | 22 47 58 4d 61 74 68 2e |include |"GXMath.|
|000002c0| 68 22 0d 23 69 6e 63 6c | 75 64 65 20 22 47 58 47 |h".#incl|ude "GXG|
|000002d0| 72 61 70 68 69 63 73 2e | 68 22 0d 23 69 6e 63 6c |raphics.|h".#incl|
|000002e0| 75 64 65 20 22 47 58 4c | 61 79 6f 75 74 2e 68 22 |ude "GXL|ayout.h"|
|000002f0| 0d 23 69 6e 63 6c 75 64 | 65 20 22 47 58 45 78 63 |.#includ|e "GXExc|
|00000300| 65 70 74 69 6f 6e 73 2e | 68 22 0d 0d 23 69 6e 63 |eptions.|h"..#inc|
|00000310| 6c 75 64 65 20 22 43 6f | 6d 70 75 74 65 4c 65 6e |lude "Co|mputeLen|
|00000320| 67 74 68 2e 68 22 0d 0d | 23 69 6e 63 6c 75 64 65 |gth.h"..|#include|
|00000330| 20 22 50 61 74 68 57 61 | 6c 6b 69 6e 67 2e 68 22 | "PathWa|lking.h"|
|00000340| 0d 23 69 6e 63 6c 75 64 | 65 20 22 41 63 63 75 72 |.#includ|e "Accur|
|00000350| 61 74 65 53 68 61 70 65 | 73 2e 68 22 0d 0d 0d 2f |ateShape|s.h".../|
|00000360| 2a 2a 2a 2a 0d 09 53 74 | 72 75 63 74 75 72 65 20 |****..St|ructure |
|00000370| 66 6f 72 20 73 74 61 74 | 65 20 72 65 71 75 69 72 |for stat|e requir|
|00000380| 65 64 0d 09 77 68 65 6e | 20 63 6f 6d 70 75 74 69 |ed..when| computi|
|00000390| 6e 67 20 53 68 61 70 65 | 4c 65 6e 67 74 68 54 6f |ng Shape|LengthTo|
|000003a0| 50 6f 69 6e 74 0d 2a 2a | 2a 2a 2f 0d 0d 74 79 70 |Point.**|**/..typ|
|000003b0| 65 64 65 66 20 73 74 72 | 75 63 74 20 7b 0d 0d 09 |edef str|uct {...|
|000003c0| 67 78 50 6f 69 6e 74 09 | 09 63 75 72 72 65 6e 74 |gxPoint.|.current|
|000003d0| 50 6f 69 6e 74 3b 09 09 | 09 09 09 09 09 2f 2f 20 |Point;..|.....// |
|000003e0| 74 68 65 20 63 75 72 72 | 65 6e 74 20 70 6f 69 6e |the curr|ent poin|
|000003f0| 74 20 69 6e 20 6f 75 72 | 20 73 74 61 74 65 2e 0d |t in our| state..|
|00000400| 09 67 78 50 6f 69 6e 74 | 09 09 66 69 72 73 74 50 |.gxPoint|..firstP|
|00000410| 6f 69 6e 74 3b 09 09 09 | 09 09 09 09 09 2f 2f 20 |oint;...|.....// |
|00000420| 74 68 65 20 66 69 72 73 | 74 20 70 6f 69 6e 74 20 |the firs|t point |
|00000430| 69 6e 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 63 |in the c|urrent c|
|00000440| 6f 6e 74 6f 75 72 2e 0d | 09 6c 6f 6e 67 09 09 09 |ontour..|.long...|
|00000450| 63 75 72 72 65 6e 74 43 | 6f 6e 74 6f 75 72 3b 09 |currentC|ontour;.|
|00000460| 09 09 09 09 09 2f 2f 20 | 74 68 65 20 63 6f 6e 74 |.....// |the cont|
|00000470| 6f 75 72 20 77 65 20 61 | 72 65 20 63 75 72 72 65 |our we a|re curre|
|00000480| 6e 74 6c 79 20 6c 6f 6f | 6b 69 6e 67 20 61 74 2e |ntly loo|king at.|
|00000490| 0d 09 6c 6f 6e 67 09 09 | 09 64 65 73 69 72 65 64 |..long..|.desired|
|000004a0| 43 6f 6e 74 6f 75 72 3b | 09 09 09 09 09 09 2f 2f |Contour;|......//|
|000004b0| 20 74 68 65 20 63 6f 6e | 74 6f 75 72 20 77 65 20 | the con|tour we |
|000004c0| 61 72 65 20 69 6e 74 65 | 72 65 73 74 65 64 20 69 |are inte|rested i|
|000004d0| 6e 2e 20 28 7a 65 72 6f | 20 6d 65 61 6e 73 20 61 |n. (zero| means a|
|000004e0| 6c 6c 20 63 6f 6e 74 6f | 75 72 73 29 0d 09 64 6f |ll conto|urs)..do|
|000004f0| 75 62 6c 65 09 09 64 65 | 73 69 72 65 64 4c 65 6e |uble..de|siredLen|
|00000500| 67 74 68 3b 09 09 09 09 | 09 09 2f 2f 20 74 68 65 |gth;....|..// the|
|00000510| 20 6c 65 6e 67 74 68 20 | 77 65 20 61 72 65 20 61 | length |we are a|
|00000520| 66 74 65 72 2e 0d 09 64 | 6f 75 62 6c 65 09 09 63 |fter...d|ouble..c|
|00000530| 75 72 72 65 6e 74 4c 65 | 6e 67 74 68 3b 09 09 09 |urrentLe|ngth;...|
|00000540| 09 09 09 2f 2f 20 63 61 | 63 68 65 20 6f 66 20 63 |...// ca|che of c|
|00000550| 75 72 72 65 6e 74 20 6c | 65 6e 67 74 68 3b 0d 0d |urrent l|ength;..|
|00000560| 09 67 78 50 6f 69 6e 74 | 09 09 6c 6f 63 61 74 69 |.gxPoint|..locati|
|00000570| 6f 6e 3b 09 09 09 09 09 | 09 09 09 09 2f 2f 20 77 |on;.....|....// w|
|00000580| 65 27 6c 6c 20 70 75 74 | 20 74 68 65 20 70 6f 73 |e'll put| the pos|
|00000590| 69 74 69 6f 6e 20 77 65 | 20 66 69 6e 64 20 68 65 |ition we| find he|
|000005a0| 72 65 2e 0d 09 67 78 50 | 6f 69 6e 74 09 09 74 61 |re...gxP|oint..ta|
|000005b0| 6e 67 65 6e 74 3b 09 09 | 09 09 09 09 09 09 09 2f |ngent;..|......./|
|000005c0| 2f 20 74 68 65 20 74 61 | 6e 67 65 6e 74 20 70 6f |/ the ta|ngent po|
|000005d0| 69 6e 74 20 77 69 6c 6c | 20 65 6e 64 20 75 70 20 |int will| end up |
|000005e0| 68 65 72 65 2e 0d 09 0d | 7d 20 54 53 68 61 70 65 |here....|} TShape|
|000005f0| 4c 65 6e 52 65 63 3b 0d | 0d 0d 2f 2a 20 43 61 6c |LenRec;.|../* Cal|
|00000600| 6c 62 61 63 6b 20 72 6f | 75 74 69 6e 65 73 20 66 |lback ro|utines f|
|00000610| 6f 72 20 53 68 61 70 65 | 4c 65 6e 67 74 68 54 6f |or Shape|LengthTo|
|00000620| 50 6f 69 6e 74 20 2a 2f | 0d 0d 0d 0d 42 6f 6f 6c |Point */|....Bool|
|00000630| 65 61 6e 09 53 68 61 70 | 65 4c 65 6e 54 6f 50 74 |ean.Shap|eLenToPt|
|00000640| 4d 6f 76 65 74 6f 28 67 | 78 50 6f 69 6e 74 20 2a |Moveto(g|xPoint *|
|00000650| 70 2c 20 54 53 68 61 70 | 65 4c 65 6e 52 65 63 2a |p, TShap|eLenRec*|
|00000660| 20 70 57 61 6c 6b 29 3b | 0d 42 6f 6f 6c 65 61 6e | pWalk);|.Boolean|
|00000670| 09 53 68 61 70 65 4c 65 | 6e 54 6f 50 74 4d 6f 76 |.ShapeLe|nToPtMov|
|00000680| 65 74 6f 28 67 78 50 6f | 69 6e 74 20 2a 70 2c 20 |eto(gxPo|int *p, |
|00000690| 54 53 68 61 70 65 4c 65 | 6e 52 65 63 2a 20 70 57 |TShapeLe|nRec* pW|
|000006a0| 61 6c 6b 29 0d 09 7b 0d | 0d 09 09 70 57 61 6c 6b |alk)..{.|...pWalk|
|000006b0| 2d 3e 63 75 72 72 65 6e | 74 50 6f 69 6e 74 2e 78 |->curren|tPoint.x|
|000006c0| 20 3d 20 70 2d 3e 78 3b | 0d 09 09 70 57 61 6c 6b | = p->x;|...pWalk|
|000006d0| 2d 3e 63 75 72 72 65 6e | 74 50 6f 69 6e 74 2e 79 |->curren|tPoint.y|
|000006e0| 20 3d 20 70 2d 3e 79 3b | 0d 09 09 70 57 61 6c 6b | = p->y;|...pWalk|
|000006f0| 2d 3e 66 69 72 73 74 50 | 6f 69 6e 74 2e 78 20 3d |->firstP|oint.x =|
|00000700| 20 70 2d 3e 78 3b 0d 09 | 09 70 57 61 6c 6b 2d 3e | p->x;..|.pWalk->|
|00000710| 66 69 72 73 74 50 6f 69 | 6e 74 2e 79 20 3d 20 70 |firstPoi|nt.y = p|
|00000720| 2d 3e 79 3b 0d 0d 09 09 | 70 57 61 6c 6b 2d 3e 63 |->y;....|pWalk->c|
|00000730| 75 72 72 65 6e 74 43 6f | 6e 74 6f 75 72 20 2b 3d |urrentCo|ntour +=|
|00000740| 20 31 3b 0d 0d 09 09 2f | 2a 20 69 66 20 77 65 27 | 1;..../|* if we'|
|00000750| 76 65 20 70 61 73 73 65 | 64 20 74 68 65 20 64 65 |ve passe|d the de|
|00000760| 73 69 72 65 64 20 63 6f | 6e 74 6f 75 72 2c 20 73 |sired co|ntour, s|
|00000770| 74 6f 70 20 65 61 72 6c | 79 20 2a 2f 0d 09 09 09 |top earl|y */....|
|00000780| 09 0d 09 09 69 66 20 28 | 20 28 70 57 61 6c 6b 2d |....if (| (pWalk-|
|00000790| 3e 64 65 73 69 72 65 64 | 43 6f 6e 74 6f 75 72 20 |>desired|Contour |
|000007a0| 21 3d 20 30 20 29 20 26 | 26 20 28 70 57 61 6c 6b |!= 0 ) &|& (pWalk|
|000007b0| 2d 3e 63 75 72 72 65 6e | 74 43 6f 6e 74 6f 75 72 |->curren|tContour|
|000007c0| 20 3e 20 70 57 61 6c 6b | 2d 3e 64 65 73 69 72 65 | > pWalk|->desire|
|000007d0| 64 43 6f 6e 74 6f 75 72 | 29 20 29 0d 09 09 09 72 |dContour|) )....r|
|000007e0| 65 74 75 72 6e 28 74 72 | 75 65 29 3b 0d 09 09 65 |eturn(tr|ue);...e|
|000007f0| 6c 73 65 09 09 09 09 0d | 09 09 09 72 65 74 75 72 |lse.....|...retur|
|00000800| 6e 28 66 61 6c 73 65 29 | 3b 0d 09 7d 0d 0d 0d 0d |n(false)|;..}....|
|00000810| 42 6f 6f 6c 65 61 6e 09 | 53 68 61 70 65 4c 65 6e |Boolean.|ShapeLen|
|00000820| 54 6f 50 74 4c 69 6e 65 | 74 6f 28 67 78 50 6f 69 |ToPtLine|to(gxPoi|
|00000830| 6e 74 20 2a 70 2c 20 54 | 53 68 61 70 65 4c 65 6e |nt *p, T|ShapeLen|
|00000840| 52 65 63 2a 20 70 57 61 | 6c 6b 29 3b 0d 42 6f 6f |Rec* pWa|lk);.Boo|
|00000850| 6c 65 61 6e 09 53 68 61 | 70 65 4c 65 6e 54 6f 50 |lean.Sha|peLenToP|
|00000860| 74 4c 69 6e 65 74 6f 28 | 67 78 50 6f 69 6e 74 20 |tLineto(|gxPoint |
|00000870| 2a 70 2c 20 54 53 68 61 | 70 65 4c 65 6e 52 65 63 |*p, TSha|peLenRec|
|00000880| 2a 20 70 57 61 6c 6b 29 | 0d 09 7b 0d 09 09 67 78 |* pWalk)|..{...gx|
|00000890| 4c 69 6e 65 09 09 09 61 | 4c 69 6e 65 3b 0d 09 09 |Line...a|Line;...|
|000008a0| 42 6f 6f 6c 65 61 6e 09 | 09 09 73 74 6f 70 20 3d |Boolean.|..stop =|
|000008b0| 20 66 61 6c 73 65 3b 0d | 09 09 64 6f 75 62 6c 65 | false;.|..double|
|000008c0| 09 09 09 73 65 67 6d 65 | 6e 74 4c 65 6e 67 74 68 |...segme|ntLength|
|000008d0| 3b 0d 0d 0d 09 09 61 4c | 69 6e 65 2e 66 69 72 73 |;.....aL|ine.firs|
|000008e0| 74 2e 78 20 3d 20 70 57 | 61 6c 6b 2d 3e 63 75 72 |t.x = pW|alk->cur|
|000008f0| 72 65 6e 74 50 6f 69 6e | 74 2e 78 3b 0d 09 09 61 |rentPoin|t.x;...a|
|00000900| 4c 69 6e 65 2e 66 69 72 | 73 74 2e 79 20 3d 20 70 |Line.fir|st.y = p|
|00000910| 57 61 6c 6b 2d 3e 63 75 | 72 72 65 6e 74 50 6f 69 |Walk->cu|rrentPoi|
|00000920| 6e 74 2e 79 3b 0d 09 09 | 61 4c 69 6e 65 2e 6c 61 |nt.y;...|aLine.la|
|00000930| 73 74 2e 78 20 3d 20 70 | 2d 3e 78 3b 0d 09 09 61 |st.x = p|->x;...a|
|00000940| 4c 69 6e 65 2e 6c 61 73 | 74 2e 79 20 3d 20 70 2d |Line.las|t.y = p-|
|00000950| 3e 79 3b 0d 09 09 0d 09 | 09 70 57 61 6c 6b 2d 3e |>y;.....|.pWalk->|
|00000960| 63 75 72 72 65 6e 74 50 | 6f 69 6e 74 2e 78 20 3d |currentP|oint.x =|
|00000970| 20 70 2d 3e 78 3b 0d 09 | 09 70 57 61 6c 6b 2d 3e | p->x;..|.pWalk->|
|00000980| 63 75 72 72 65 6e 74 50 | 6f 69 6e 74 2e 79 20 3d |currentP|oint.y =|
|00000990| 20 70 2d 3e 79 3b 0d 09 | 09 0d 09 09 69 66 20 28 | p->y;..|....if (|
|000009a0| 20 28 70 57 61 6c 6b 2d | 3e 64 65 73 69 72 65 64 | (pWalk-|>desired|
|000009b0| 43 6f 6e 74 6f 75 72 20 | 3d 3d 20 30 29 20 7c 7c |Contour |== 0) |||
|000009c0| 20 28 70 57 61 6c 6b 2d | 3e 63 75 72 72 65 6e 74 | (pWalk-|>current|
|000009d0| 43 6f 6e 74 6f 75 72 20 | 3d 3d 20 70 57 61 6c 6b |Contour |== pWalk|
|000009e0| 2d 3e 64 65 73 69 72 65 | 64 43 6f 6e 74 6f 75 72 |->desire|dContour|
|000009f0| 29 20 20 29 20 7b 0d 09 | 09 0d 09 09 09 73 65 67 |) ) {..|.....seg|
|00000a00| 6d 65 6e 74 4c 65 6e 67 | 74 68 20 3d 20 47 65 74 |mentLeng|th = Get|
|00000a10| 4c 69 6e 65 4c 65 6e 67 | 74 68 28 26 61 4c 69 6e |LineLeng|th(&aLin|
|00000a20| 65 29 3b 0d 09 09 09 0d | 09 09 09 2f 2a 20 69 66 |e);.....|.../* if|
|00000a30| 20 77 65 27 76 65 20 65 | 78 63 65 65 64 65 64 20 | we've e|xceeded |
|00000a40| 74 68 65 20 64 65 73 69 | 72 65 64 20 6c 65 6e 67 |the desi|red leng|
|00000a50| 74 68 2c 20 74 68 65 6e | 20 77 65 27 72 65 20 6f |th, then| we're o|
|00000a60| 6e 20 74 68 65 20 63 6f | 72 72 65 63 74 20 73 65 |n the co|rrect se|
|00000a70| 67 6d 65 6e 74 20 2a 2f | 0d 09 09 09 0d 09 09 09 |gment */|........|
|00000a80| 69 66 20 28 70 57 61 6c | 6b 2d 3e 63 75 72 72 65 |if (pWal|k->curre|
|00000a90| 6e 74 4c 65 6e 67 74 68 | 20 2b 20 73 65 67 6d 65 |ntLength| + segme|
|00000aa0| 6e 74 4c 65 6e 67 74 68 | 20 3e 3d 20 70 57 61 6c |ntLength| >= pWal|
|00000ab0| 6b 2d 3e 64 65 73 69 72 | 65 64 4c 65 6e 67 74 68 |k->desir|edLength|
|00000ac0| 29 20 7b 0d 09 09 09 0d | 09 09 09 09 2f 2a 20 66 |) {.....|..../* f|
|00000ad0| 69 6e 64 20 74 68 65 20 | 70 6f 69 6e 74 20 6f 6e |ind the |point on|
|00000ae0| 20 74 68 69 73 20 73 65 | 67 6d 65 6e 74 20 74 68 | this se|gment th|
|00000af0| 61 74 20 69 73 20 74 68 | 65 20 6c 65 6e 67 74 68 |at is th|e length|
|00000b00| 20 77 65 20 77 61 6e 74 | 20 2a 2f 0d 09 09 09 09 | we want| */.....|
|00000b10| 0d 09 09 09 09 4c 69 6e | 65 4c 65 6e 67 74 68 54 |.....Lin|eLengthT|
|00000b20| 6f 50 6f 69 6e 74 28 70 | 57 61 6c 6b 2d 3e 64 65 |oPoint(p|Walk->de|
|00000b30| 73 69 72 65 64 4c 65 6e | 67 74 68 20 2d 20 70 57 |siredLen|gth - pW|
|00000b40| 61 6c 6b 2d 3e 63 75 72 | 72 65 6e 74 4c 65 6e 67 |alk->cur|rentLeng|
|00000b50| 74 68 2c 20 26 61 4c 69 | 6e 65 2c 20 26 28 70 57 |th, &aLi|ne, &(pW|
|00000b60| 61 6c 6b 2d 3e 6c 6f 63 | 61 74 69 6f 6e 29 2c 20 |alk->loc|ation), |
|00000b70| 26 28 70 57 61 6c 6b 2d | 3e 74 61 6e 67 65 6e 74 |&(pWalk-|>tangent|
|00000b80| 29 20 29 3b 0d 0d 09 09 | 09 09 73 74 6f 70 20 3d |) );....|..stop =|
|00000b90| 20 74 72 75 65 3b 0d 09 | 09 09 0d 09 09 09 7d 2f | true;..|......}/|
|00000ba0| 2f 65 6e 64 20 69 66 0d | 09 09 0d 09 09 09 70 57 |/end if.|......pW|
|00000bb0| 61 6c 6b 2d 3e 63 75 72 | 72 65 6e 74 4c 65 6e 67 |alk->cur|rentLeng|
|00000bc0| 74 68 20 2b 3d 20 73 65 | 67 6d 65 6e 74 4c 65 6e |th += se|gmentLen|
|00000bd0| 67 74 68 3b 0d 0d 09 09 | 7d 2f 2f 65 6e 64 20 69 |gth;....|}//end i|
|00000be0| 66 0d 09 09 09 09 0d 09 | 09 72 65 74 75 72 6e 28 |f.......|.return(|
|00000bf0| 73 74 6f 70 29 3b 0d 09 | 7d 0d 0d 0d 0d 42 6f 6f |stop);..|}....Boo|
|00000c00| 6c 65 61 6e 09 53 68 61 | 70 65 4c 65 6e 54 6f 50 |lean.Sha|peLenToP|
|00000c10| 74 43 75 72 76 65 74 6f | 28 67 78 50 6f 69 6e 74 |tCurveto|(gxPoint|
|00000c20| 20 70 5b 33 5d 2c 20 54 | 53 68 61 70 65 4c 65 6e | p[3], T|ShapeLen|
|00000c30| 52 65 63 2a 20 70 57 61 | 6c 6b 29 3b 0d 42 6f 6f |Rec* pWa|lk);.Boo|
|00000c40| 6c 65 61 6e 09 53 68 61 | 70 65 4c 65 6e 54 6f 50 |lean.Sha|peLenToP|
|00000c50| 74 43 75 72 76 65 74 6f | 28 67 78 50 6f 69 6e 74 |tCurveto|(gxPoint|
|00000c60| 20 70 5b 33 5d 2c 20 54 | 53 68 61 70 65 4c 65 6e | p[3], T|ShapeLen|
|00000c70| 52 65 63 2a 20 70 57 61 | 6c 6b 29 0d 09 7b 0d 09 |Rec* pWa|lk)..{..|
|00000c80| 09 67 78 43 75 72 76 65 | 09 09 61 43 75 72 76 65 |.gxCurve|..aCurve|
|00000c90| 3b 0d 09 09 42 6f 6f 6c | 65 61 6e 09 09 73 74 6f |;...Bool|ean..sto|
|00000ca0| 70 20 3d 20 66 61 6c 73 | 65 3b 09 09 0d 09 09 64 |p = fals|e;.....d|
|00000cb0| 6f 75 62 6c 65 09 09 73 | 65 67 6d 65 6e 74 4c 65 |ouble..s|egmentLe|
|00000cc0| 6e 67 74 68 3b 0d 0d 09 | 09 61 43 75 72 76 65 2e |ngth;...|.aCurve.|
|00000cd0| 66 69 72 73 74 2e 78 20 | 3d 20 70 5b 30 5d 2e 78 |first.x |= p[0].x|
|00000ce0| 3b 0d 09 09 61 43 75 72 | 76 65 2e 66 69 72 73 74 |;...aCur|ve.first|
|00000cf0| 2e 79 20 3d 20 70 5b 30 | 5d 2e 79 3b 0d 09 09 61 |.y = p[0|].y;...a|
|00000d00| 43 75 72 76 65 2e 63 6f | 6e 74 72 6f 6c 2e 78 20 |Curve.co|ntrol.x |
|00000d10| 3d 20 70 5b 31 5d 2e 78 | 3b 0d 09 09 61 43 75 72 |= p[1].x|;...aCur|
|00000d20| 76 65 2e 63 6f 6e 74 72 | 6f 6c 2e 79 20 3d 20 70 |ve.contr|ol.y = p|
|00000d30| 5b 31 5d 2e 79 3b 0d 09 | 09 61 43 75 72 76 65 2e |[1].y;..|.aCurve.|
|00000d40| 6c 61 73 74 2e 78 20 3d | 20 70 5b 32 5d 2e 78 3b |last.x =| p[2].x;|
|00000d50| 0d 09 09 61 43 75 72 76 | 65 2e 6c 61 73 74 2e 79 |...aCurv|e.last.y|
|00000d60| 20 3d 20 70 5b 32 5d 2e | 79 3b 0d 09 09 0d 09 09 | = p[2].|y;......|
|00000d70| 70 57 61 6c 6b 2d 3e 63 | 75 72 72 65 6e 74 50 6f |pWalk->c|urrentPo|
|00000d80| 69 6e 74 2e 78 20 3d 20 | 70 5b 32 5d 2e 78 3b 0d |int.x = |p[2].x;.|
|00000d90| 09 09 70 57 61 6c 6b 2d | 3e 63 75 72 72 65 6e 74 |..pWalk-|>current|
|00000da0| 50 6f 69 6e 74 2e 79 20 | 3d 20 70 5b 32 5d 2e 79 |Point.y |= p[2].y|
|00000db0| 3b 0d 09 09 09 09 0d 09 | 09 69 66 20 28 20 28 70 |;.......|.if ( (p|
|00000dc0| 57 61 6c 6b 2d 3e 64 65 | 73 69 72 65 64 43 6f 6e |Walk->de|siredCon|
|00000dd0| 74 6f 75 72 20 3d 3d 20 | 30 29 20 7c 7c 20 28 70 |tour == |0) || (p|
|00000de0| 57 61 6c 6b 2d 3e 63 75 | 72 72 65 6e 74 43 6f 6e |Walk->cu|rrentCon|
|00000df0| 74 6f 75 72 20 3d 3d 20 | 70 57 61 6c 6b 2d 3e 64 |tour == |pWalk->d|
|00000e00| 65 73 69 72 65 64 43 6f | 6e 74 6f 75 72 29 20 20 |esiredCo|ntour) |
|00000e10| 29 20 7b 0d 09 09 0d 09 | 09 09 73 65 67 6d 65 6e |) {.....|..segmen|
|00000e20| 74 4c 65 6e 67 74 68 20 | 3d 20 47 65 74 43 75 72 |tLength |= GetCur|
|00000e30| 76 65 4c 65 6e 67 74 68 | 28 26 61 43 75 72 76 65 |veLength|(&aCurve|
|00000e40| 29 3b 0d 09 09 09 0d 09 | 09 09 2f 2a 20 69 66 20 |);......|../* if |
|00000e50| 77 65 27 76 65 20 65 78 | 63 65 65 64 65 64 20 74 |we've ex|ceeded t|
|00000e60| 68 65 20 64 65 73 69 72 | 65 64 20 6c 65 6e 67 74 |he desir|ed lengt|
|00000e70| 68 2c 20 74 68 65 6e 20 | 77 65 27 72 65 20 6f 6e |h, then |we're on|
|00000e80| 20 74 68 65 20 63 6f 72 | 72 65 63 74 20 73 65 67 | the cor|rect seg|
|00000e90| 6d 65 6e 74 20 2a 2f 0d | 09 09 09 0d 09 09 09 69 |ment */.|.......i|
|00000ea0| 66 20 28 70 57 61 6c 6b | 2d 3e 63 75 72 72 65 6e |f (pWalk|->curren|
|00000eb0| 74 4c 65 6e 67 74 68 20 | 2b 20 73 65 67 6d 65 6e |tLength |+ segmen|
|00000ec0| 74 4c 65 6e 67 74 68 20 | 3e 3d 20 70 57 61 6c 6b |tLength |>= pWalk|
|00000ed0| 2d 3e 64 65 73 69 72 65 | 64 4c 65 6e 67 74 68 29 |->desire|dLength)|
|00000ee0| 20 7b 0d 09 09 09 0d 09 | 09 09 09 2f 2a 20 66 69 | {......|.../* fi|
|00000ef0| 6e 64 20 74 68 65 20 70 | 6f 69 6e 74 20 6f 6e 20 |nd the p|oint on |
|00000f00| 74 68 69 73 20 73 65 67 | 6d 65 6e 74 20 74 68 61 |this seg|ment tha|
|00000f10| 74 20 69 73 20 74 68 65 | 20 6c 65 6e 67 74 68 20 |t is the| length |
|00000f20| 77 65 20 77 61 6e 74 20 | 2a 2f 0d 09 09 09 09 09 |we want |*/......|
|00000f30| 09 09 09 0d 09 09 09 09 | 43 75 72 76 65 4c 65 6e |........|CurveLen|
|00000f40| 67 74 68 54 6f 50 6f 69 | 6e 74 28 70 57 61 6c 6b |gthToPoi|nt(pWalk|
|00000f50| 2d 3e 64 65 73 69 72 65 | 64 4c 65 6e 67 74 68 20 |->desire|dLength |
|00000f60| 2d 20 70 57 61 6c 6b 2d | 3e 63 75 72 72 65 6e 74 |- pWalk-|>current|
|00000f70| 4c 65 6e 67 74 68 2c 20 | 26 61 43 75 72 76 65 2c |Length, |&aCurve,|
|00000f80| 20 26 28 70 57 61 6c 6b | 2d 3e 6c 6f 63 61 74 69 | &(pWalk|->locati|
|00000f90| 6f 6e 29 2c 20 26 28 70 | 57 61 6c 6b 2d 3e 74 61 |on), &(p|Walk->ta|
|00000fa0| 6e 67 65 6e 74 29 20 29 | 3b 0d 09 09 09 09 0d 09 |ngent) )|;.......|
|00000fb0| 09 09 09 73 74 6f 70 20 | 3d 20 74 72 75 65 3b 0d |...stop |= true;.|
|00000fc0| 09 09 09 0d 09 09 09 7d | 2f 2f 65 6e 64 20 69 66 |.......}|//end if|
|00000fd0| 0d 09 09 0d 09 09 09 70 | 57 61 6c 6b 2d 3e 63 75 |.......p|Walk->cu|
|00000fe0| 72 72 65 6e 74 4c 65 6e | 67 74 68 20 2b 3d 20 73 |rrentLen|gth += s|
|00000ff0| 65 67 6d 65 6e 74 4c 65 | 6e 67 74 68 3b 0d 0d 09 |egmentLe|ngth;...|
|00001000| 09 7d 2f 2f 65 6e 64 20 | 69 66 0d 0d 09 09 72 65 |.}//end |if....re|
|00001010| 74 75 72 6e 28 73 74 6f | 70 29 3b 0d 09 7d 0d 0d |turn(sto|p);..}..|
|00001020| 0d 0d 42 6f 6f 6c 65 61 | 6e 20 53 68 61 70 65 4c |..Boolea|n ShapeL|
|00001030| 65 6e 54 6f 50 74 43 6c | 6f 73 65 70 61 74 68 28 |enToPtCl|osepath(|
|00001040| 20 54 53 68 61 70 65 4c | 65 6e 52 65 63 2a 20 70 | TShapeL|enRec* p|
|00001050| 57 61 6c 6b 29 3b 0d 42 | 6f 6f 6c 65 61 6e 20 53 |Walk);.B|oolean S|
|00001060| 68 61 70 65 4c 65 6e 54 | 6f 50 74 43 6c 6f 73 65 |hapeLenT|oPtClose|
|00001070| 70 61 74 68 28 20 54 53 | 68 61 70 65 4c 65 6e 52 |path( TS|hapeLenR|
|00001080| 65 63 2a 20 70 57 61 6c | 6b 29 0d 09 7b 0d 09 09 |ec* pWal|k)..{...|
|00001090| 42 6f 6f 6c 65 61 6e 09 | 09 09 73 74 6f 70 20 3d |Boolean.|..stop =|
|000010a0| 20 66 61 6c 73 65 3b 0d | 09 09 67 78 4c 69 6e 65 | false;.|..gxLine|
|000010b0| 09 09 09 61 4c 69 6e 65 | 3b 0d 09 09 64 6f 75 62 |...aLine|;...doub|
|000010c0| 6c 65 09 09 09 73 65 67 | 6d 65 6e 74 4c 65 6e 67 |le...seg|mentLeng|
|000010d0| 74 68 3b 0d 09 09 0d 09 | 09 61 4c 69 6e 65 2e 66 |th;.....|.aLine.f|
|000010e0| 69 72 73 74 2e 78 20 3d | 20 70 57 61 6c 6b 2d 3e |irst.x =| pWalk->|
|000010f0| 63 75 72 72 65 6e 74 50 | 6f 69 6e 74 2e 78 3b 0d |currentP|oint.x;.|
|00001100| 09 09 61 4c 69 6e 65 2e | 66 69 72 73 74 2e 79 20 |..aLine.|first.y |
|00001110| 3d 20 70 57 61 6c 6b 2d | 3e 63 75 72 72 65 6e 74 |= pWalk-|>current|
|00001120| 50 6f 69 6e 74 2e 79 3b | 0d 09 09 61 4c 69 6e 65 |Point.y;|...aLine|
|00001130| 2e 6c 61 73 74 2e 78 20 | 3d 20 70 57 61 6c 6b 2d |.last.x |= pWalk-|
|00001140| 3e 66 69 72 73 74 50 6f | 69 6e 74 2e 78 3b 0d 09 |>firstPo|int.x;..|
|00001150| 09 61 4c 69 6e 65 2e 6c | 61 73 74 2e 79 20 3d 20 |.aLine.l|ast.y = |
|00001160| 70 57 61 6c 6b 2d 3e 66 | 69 72 73 74 50 6f 69 6e |pWalk->f|irstPoin|
|00001170| 74 2e 79 3b 0d 09 09 09 | 09 0d 09 09 70 57 61 6c |t.y;....|....pWal|
|00001180| 6b 2d 3e 63 75 72 72 65 | 6e 74 50 6f 69 6e 74 2e |k->curre|ntPoint.|
|00001190| 78 20 3d 20 70 57 61 6c | 6b 2d 3e 66 69 72 73 74 |x = pWal|k->first|
|000011a0| 50 6f 69 6e 74 2e 78 3b | 0d 09 09 70 57 61 6c 6b |Point.x;|...pWalk|
|000011b0| 2d 3e 63 75 72 72 65 6e | 74 50 6f 69 6e 74 2e 79 |->curren|tPoint.y|
|000011c0| 20 3d 20 70 57 61 6c 6b | 2d 3e 66 69 72 73 74 50 | = pWalk|->firstP|
|000011d0| 6f 69 6e 74 2e 79 3b 0d | 09 09 0d 09 09 69 66 20 |oint.y;.|.....if |
|000011e0| 28 20 28 70 57 61 6c 6b | 2d 3e 64 65 73 69 72 65 |( (pWalk|->desire|
|000011f0| 64 43 6f 6e 74 6f 75 72 | 20 3d 3d 20 30 29 20 7c |dContour| == 0) ||
|00001200| 7c 20 28 70 57 61 6c 6b | 2d 3e 63 75 72 72 65 6e || (pWalk|->curren|
|00001210| 74 43 6f 6e 74 6f 75 72 | 20 3d 3d 20 70 57 61 6c |tContour| == pWal|
|00001220| 6b 2d 3e 64 65 73 69 72 | 65 64 43 6f 6e 74 6f 75 |k->desir|edContou|
|00001230| 72 29 20 20 29 20 7b 0d | 09 09 0d 09 09 09 73 65 |r) ) {.|......se|
|00001240| 67 6d 65 6e 74 4c 65 6e | 67 74 68 20 3d 20 47 65 |gmentLen|gth = Ge|
|00001250| 74 4c 69 6e 65 4c 65 6e | 67 74 68 28 26 61 4c 69 |tLineLen|gth(&aLi|
|00001260| 6e 65 29 3b 0d 09 09 09 | 0d 09 09 09 2f 2a 20 69 |ne);....|..../* i|
|00001270| 66 20 77 65 27 76 65 20 | 65 78 63 65 65 64 65 64 |f we've |exceeded|
|00001280| 20 74 68 65 20 64 65 73 | 69 72 65 64 20 6c 65 6e | the des|ired len|
|00001290| 67 74 68 2c 20 74 68 65 | 6e 20 77 65 27 72 65 20 |gth, the|n we're |
|000012a0| 6f 6e 20 74 68 65 20 63 | 6f 72 72 65 63 74 20 73 |on the c|orrect s|
|000012b0| 65 67 6d 65 6e 74 20 2a | 2f 0d 09 09 09 0d 09 09 |egment *|/.......|
|000012c0| 09 69 66 20 28 70 57 61 | 6c 6b 2d 3e 63 75 72 72 |.if (pWa|lk->curr|
|000012d0| 65 6e 74 4c 65 6e 67 74 | 68 20 2b 20 73 65 67 6d |entLengt|h + segm|
|000012e0| 65 6e 74 4c 65 6e 67 74 | 68 20 3e 3d 20 70 57 61 |entLengt|h >= pWa|
|000012f0| 6c 6b 2d 3e 64 65 73 69 | 72 65 64 4c 65 6e 67 74 |lk->desi|redLengt|
|00001300| 68 29 20 7b 0d 09 09 09 | 0d 09 09 09 09 2f 2a 20 |h) {....|...../* |
|00001310| 66 69 6e 64 20 74 68 65 | 20 70 6f 69 6e 74 20 6f |find the| point o|
|00001320| 6e 20 74 68 69 73 20 73 | 65 67 6d 65 6e 74 20 74 |n this s|egment t|
|00001330| 68 61 74 20 69 73 20 74 | 68 65 20 6c 65 6e 67 74 |hat is t|he lengt|
|00001340| 68 20 77 65 20 77 61 6e | 74 20 2a 2f 0d 09 09 09 |h we wan|t */....|
|00001350| 09 0d 09 09 09 09 4c 69 | 6e 65 4c 65 6e 67 74 68 |......Li|neLength|
|00001360| 54 6f 50 6f 69 6e 74 28 | 70 57 61 6c 6b 2d 3e 64 |ToPoint(|pWalk->d|
|00001370| 65 73 69 72 65 64 4c 65 | 6e 67 74 68 20 2d 20 70 |esiredLe|ngth - p|
|00001380| 57 61 6c 6b 2d 3e 63 75 | 72 72 65 6e 74 4c 65 6e |Walk->cu|rrentLen|
|00001390| 67 74 68 2c 20 26 61 4c | 69 6e 65 2c 20 26 28 70 |gth, &aL|ine, &(p|
|000013a0| 57 61 6c 6b 2d 3e 6c 6f | 63 61 74 69 6f 6e 29 2c |Walk->lo|cation),|
|000013b0| 20 26 28 70 57 61 6c 6b | 2d 3e 74 61 6e 67 65 6e | &(pWalk|->tangen|
|000013c0| 74 29 20 29 3b 0d 0d 09 | 09 09 09 73 74 6f 70 20 |t) );...|...stop |
|000013d0| 3d 20 74 72 75 65 3b 0d | 09 09 09 0d 09 09 09 7d |= true;.|.......}|
|000013e0| 2f 2f 65 6e 64 20 69 66 | 0d 09 09 0d 09 09 09 70 |//end if|.......p|
|000013f0| 57 61 6c 6b 2d 3e 63 75 | 72 72 65 6e 74 4c 65 6e |Walk->cu|rrentLen|
|00001400| 67 74 68 20 2b 3d 20 73 | 65 67 6d 65 6e 74 4c 65 |gth += s|egmentLe|
|00001410| 6e 67 74 68 3b 0d 0d 09 | 09 7d 2f 2f 65 6e 64 20 |ngth;...|.}//end |
|00001420| 69 66 0d 0d 09 09 72 65 | 74 75 72 6e 28 73 74 6f |if....re|turn(sto|
|00001430| 70 29 3b 0d 09 7d 0d 0d | 0d 0d 0d 2f 2a 2a 2a 2a |p);..}..|.../****|
|00001440| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001450| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001460| 2a 2a 2a 2a 2a 0d 0d 09 | 52 6f 75 74 69 6e 65 3a |*****...|Routine:|
|00001470| 20 41 63 63 75 72 61 74 | 65 53 68 61 70 65 4c 65 | Accurat|eShapeLe|
|00001480| 6e 67 74 68 54 6f 50 6f | 69 6e 74 2e 0d 09 0d 09 |ngthToPo|int.....|
|00001490| 52 65 70 6c 61 63 65 6d | 65 6e 74 20 66 6f 72 20 |Replacem|ent for |
|000014a0| 47 58 53 68 61 70 65 4c | 65 6e 67 74 68 54 6f 50 |GXShapeL|engthToP|
|000014b0| 6f 69 6e 74 2e 0d 09 0d | 2a 2a 2a 2a 2a 2a 2a 2a |oint....|********|
|000014c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000014d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000014e0| 2a 2a 2f 0d 0d 67 78 50 | 6f 69 6e 74 2a 20 41 63 |**/..gxP|oint* Ac|
|000014f0| 63 75 72 61 74 65 53 68 | 61 70 65 4c 65 6e 67 74 |curateSh|apeLengt|
|00001500| 68 54 6f 50 6f 69 6e 74 | 28 67 78 53 68 61 70 65 |hToPoint|(gxShape|
|00001510| 20 74 61 72 67 65 74 2c | 20 6c 6f 6e 67 20 69 6e | target,| long in|
|00001520| 64 65 78 2c 20 46 69 78 | 65 64 20 6c 65 6e 67 74 |dex, Fix|ed lengt|
|00001530| 68 2c 20 67 78 50 6f 69 | 6e 74 20 2a 6c 6f 63 61 |h, gxPoi|nt *loca|
|00001540| 74 69 6f 6e 2c 20 67 78 | 50 6f 69 6e 74 20 2a 74 |tion, gx|Point *t|
|00001550| 61 6e 67 65 6e 74 29 0d | 09 7b 0d 09 09 42 6f 6f |angent).|.{...Boo|
|00001560| 6c 65 61 6e 09 09 09 09 | 09 73 74 6f 70 70 65 64 |lean....|.stopped|
|00001570| 45 61 72 6c 79 3b 09 0d | 09 09 54 53 68 61 70 65 |Early;..|..TShape|
|00001580| 4c 65 6e 52 65 63 09 09 | 73 68 61 70 65 4c 65 6e |LenRec..|shapeLen|
|00001590| 52 65 63 3b 0d 09 09 67 | 78 50 6f 69 6e 74 09 09 |Rec;...g|xPoint..|
|000015a0| 09 09 09 2a 72 65 73 75 | 6c 74 3b 0d 09 09 0d 09 |...*resu|lt;.....|
|000015b0| 09 72 65 73 75 6c 74 20 | 3d 20 6c 6f 63 61 74 69 |.result |= locati|
|000015c0| 6f 6e 3b 0d 0d 09 09 2f | 2a 20 69 6e 69 74 69 61 |on;..../|* initia|
|000015d0| 6c 69 7a 65 20 74 68 65 | 20 73 74 72 75 63 74 75 |lize the| structu|
|000015e0| 72 65 20 74 68 61 74 20 | 6d 61 69 6e 74 61 69 6e |re that |maintain|
|000015f0| 73 20 6f 75 72 20 73 74 | 61 74 65 2e 20 2a 2f 0d |s our st|ate. */.|
|00001600| 09 09 0d 09 09 73 68 61 | 70 65 4c 65 6e 52 65 63 |.....sha|peLenRec|
|00001610| 2e 63 75 72 72 65 6e 74 | 43 6f 6e 74 6f 75 72 20 |.current|Contour |
|00001620| 3d 20 30 3b 0d 09 09 73 | 68 61 70 65 4c 65 6e 52 |= 0;...s|hapeLenR|
|00001630| 65 63 2e 64 65 73 69 72 | 65 64 43 6f 6e 74 6f 75 |ec.desir|edContou|
|00001640| 72 20 3d 20 69 6e 64 65 | 78 3b 0d 09 09 73 68 61 |r = inde|x;...sha|
|00001650| 70 65 4c 65 6e 52 65 63 | 2e 63 75 72 72 65 6e 74 |peLenRec|.current|
|00001660| 4c 65 6e 67 74 68 20 3d | 20 30 2e 30 3b 0d 09 09 |Length =| 0.0;...|
|00001670| 73 68 61 70 65 4c 65 6e | 52 65 63 2e 64 65 73 69 |shapeLen|Rec.desi|
|00001680| 72 65 64 4c 65 6e 67 74 | 68 20 3d 20 46 69 78 65 |redLengt|h = Fixe|
|00001690| 64 54 6f 44 6f 75 62 6c | 65 28 6c 65 6e 67 74 68 |dToDoubl|e(length|
|000016a0| 29 3b 0d 0d 09 09 2f 2a | 20 4e 6f 77 20 77 61 6c |);..../*| Now wal|
|000016b0| 6b 20 74 68 65 20 73 68 | 61 70 65 20 75 73 69 6e |k the sh|ape usin|
|000016c0| 67 20 6f 75 72 20 73 68 | 61 70 65 20 6c 65 6e 67 |g our sh|ape leng|
|000016d0| 74 68 20 63 61 6c 63 75 | 6c 61 74 69 6f 6e 20 63 |th calcu|lation c|
|000016e0| 61 6c 6c 62 61 63 6b 73 | 2e 20 2a 2f 0d 09 09 09 |allbacks|. */....|
|000016f0| 09 0d 09 09 73 74 6f 70 | 70 65 64 45 61 72 6c 79 |....stop|pedEarly|
|00001700| 20 3d 20 53 68 61 70 65 | 57 61 6c 6b 65 72 28 74 | = Shape|Walker(t|
|00001710| 61 72 67 65 74 2c 20 53 | 68 61 70 65 4c 65 6e 54 |arget, S|hapeLenT|
|00001720| 6f 50 74 4d 6f 76 65 74 | 6f 2c 20 53 68 61 70 65 |oPtMovet|o, Shape|
|00001730| 4c 65 6e 54 6f 50 74 4c | 69 6e 65 74 6f 2c 20 53 |LenToPtL|ineto, S|
|00001740| 68 61 70 65 4c 65 6e 54 | 6f 50 74 43 75 72 76 65 |hapeLenT|oPtCurve|
|00001750| 74 6f 2c 20 53 68 61 70 | 65 4c 65 6e 54 6f 50 74 |to, Shap|eLenToPt|
|00001760| 43 6c 6f 73 65 70 61 74 | 68 2c 20 26 73 68 61 70 |Closepat|h, &shap|
|00001770| 65 4c 65 6e 52 65 63 29 | 3b 0d 0d 09 09 2f 2a 20 |eLenRec)|;..../* |
|00001780| 69 66 20 77 65 20 64 69 | 64 6e 27 74 20 73 74 6f |if we di|dn't sto|
|00001790| 70 20 65 61 72 6c 79 2c | 20 74 68 65 6e 20 74 68 |p early,| then th|
|000017a0| 65 20 77 61 6c 6b 65 72 | 20 67 6f 74 20 74 6f 20 |e walker| got to |
|000017b0| 74 68 65 20 65 6e 64 20 | 6f 66 20 74 68 65 20 73 |the end |of the s|
|000017c0| 68 61 70 65 20 77 69 74 | 68 6f 75 74 20 66 69 6e |hape wit|hout fin|
|000017d0| 64 69 6e 67 20 74 68 65 | 20 61 6e 73 77 65 72 20 |ding the| answer |
|000017e0| 2a 2f 0d 09 09 0d 09 09 | 69 66 20 28 73 74 6f 70 |*/......|if (stop|
|000017f0| 70 65 64 45 61 72 6c 79 | 29 20 7b 0d 0d 09 09 09 |pedEarly|) {.....|
|00001800| 69 66 20 28 6c 6f 63 61 | 74 69 6f 6e 29 20 7b 0d |if (loca|tion) {.|
|00001810| 09 09 09 09 6c 6f 63 61 | 74 69 6f 6e 2d 3e 78 20 |....loca|tion->x |
|00001820| 3d 20 73 68 61 70 65 4c | 65 6e 52 65 63 2e 6c 6f |= shapeL|enRec.lo|
|00001830| 63 61 74 69 6f 6e 2e 78 | 3b 0d 09 09 09 09 6c 6f |cation.x|;.....lo|
|00001840| 63 61 74 69 6f 6e 2d 3e | 79 20 3d 20 73 68 61 70 |cation->|y = shap|
|00001850| 65 4c 65 6e 52 65 63 2e | 6c 6f 63 61 74 69 6f 6e |eLenRec.|location|
|00001860| 2e 79 3b 0d 09 09 09 7d | 0d 09 09 09 0d 09 09 09 |.y;....}|........|
|00001870| 69 66 20 28 74 61 6e 67 | 65 6e 74 29 20 7b 0d 09 |if (tang|ent) {..|
|00001880| 09 09 09 74 61 6e 67 65 | 6e 74 2d 3e 78 20 3d 20 |...tange|nt->x = |
|00001890| 73 68 61 70 65 4c 65 6e | 52 65 63 2e 74 61 6e 67 |shapeLen|Rec.tang|
|000018a0| 65 6e 74 2e 78 3b 0d 09 | 09 09 09 74 61 6e 67 65 |ent.x;..|...tange|
|000018b0| 6e 74 2d 3e 79 20 3d 20 | 73 68 61 70 65 4c 65 6e |nt->y = |shapeLen|
|000018c0| 52 65 63 2e 74 61 6e 67 | 65 6e 74 2e 79 3b 0d 09 |Rec.tang|ent.y;..|
|000018d0| 09 09 7d 09 09 0d 09 09 | 0d 09 09 7d 20 65 6c 73 |..}.....|...} els|
|000018e0| 65 20 7b 0d 09 09 0d 09 | 09 09 47 58 50 6f 73 74 |e {.....|..GXPost|
|000018f0| 47 72 61 70 68 69 63 73 | 45 72 72 6f 72 28 6c 65 |Graphics|Error(le|
|00001900| 6e 67 74 68 5f 6f 75 74 | 5f 6f 66 5f 72 61 6e 67 |ngth_out|_of_rang|
|00001910| 65 29 3b 0d 09 09 09 0d | 09 09 7d 2f 2f 65 6e 64 |e);.....|..}//end|
|00001920| 20 69 66 0d 0d 09 09 72 | 65 74 75 72 6e 28 72 65 | if....r|eturn(re|
|00001930| 73 75 6c 74 29 3b 0d 09 | 0d 09 7d 2f 2f 41 63 63 |sult);..|..}//Acc|
|00001940| 75 72 61 74 65 53 68 61 | 70 65 4c 65 6e 67 74 68 |urateSha|peLength|
|00001950| 54 6f 50 6f 69 6e 74 0d | 0d 0d 0d 0d 2f 2a 2a 2a |ToPoint.|..../***|
|00001960| 2a 2a 2a 20 63 61 6c 6c | 62 61 63 6b 20 52 6f 75 |*** call|back Rou|
|00001970| 74 69 6e 65 73 20 66 6f | 72 20 63 6f 6d 70 75 74 |tines fo|r comput|
|00001980| 69 6e 67 20 74 6f 74 61 | 6c 20 6c 65 6e 67 74 68 |ing tota|l length|
|00001990| 20 6f 66 20 74 68 65 20 | 73 68 61 70 65 20 2a 2a | of the |shape **|
|000019a0| 2a 2a 2a 2f 0d 0d 42 6f | 6f 6c 65 61 6e 09 53 68 |***/..Bo|olean.Sh|
|000019b0| 61 70 65 4c 65 6e 4d 6f | 76 65 74 6f 28 67 78 50 |apeLenMo|veto(gxP|
|000019c0| 6f 69 6e 74 20 2a 70 2c | 20 54 53 68 61 70 65 4c |oint *p,| TShapeL|
|000019d0| 65 6e 52 65 63 2a 20 70 | 57 61 6c 6b 29 3b 0d 42 |enRec* p|Walk);.B|
|000019e0| 6f 6f 6c 65 61 6e 09 53 | 68 61 70 65 4c 65 6e 4d |oolean.S|hapeLenM|
|000019f0| 6f 76 65 74 6f 28 67 78 | 50 6f 69 6e 74 20 2a 70 |oveto(gx|Point *p|
|00001a00| 2c 20 54 53 68 61 70 65 | 4c 65 6e 52 65 63 2a 20 |, TShape|LenRec* |
|00001a10| 70 57 61 6c 6b 29 0d 09 | 7b 0d 0d 09 09 70 57 61 |pWalk)..|{....pWa|
|00001a20| 6c 6b 2d 3e 63 75 72 72 | 65 6e 74 50 6f 69 6e 74 |lk->curr|entPoint|
|00001a30| 2e 78 20 3d 20 70 2d 3e | 78 3b 0d 09 09 70 57 61 |.x = p->|x;...pWa|
|00001a40| 6c 6b 2d 3e 63 75 72 72 | 65 6e 74 50 6f 69 6e 74 |lk->curr|entPoint|
|00001a50| 2e 79 20 3d 20 70 2d 3e | 79 3b 0d 09 09 70 57 61 |.y = p->|y;...pWa|
|00001a60| 6c 6b 2d 3e 66 69 72 73 | 74 50 6f 69 6e 74 2e 78 |lk->firs|tPoint.x|
|00001a70| 20 3d 20 70 2d 3e 78 3b | 0d 09 09 70 57 61 6c 6b | = p->x;|...pWalk|
|00001a80| 2d 3e 66 69 72 73 74 50 | 6f 69 6e 74 2e 79 20 3d |->firstP|oint.y =|
|00001a90| 20 70 2d 3e 79 3b 0d 0d | 09 09 70 57 61 6c 6b 2d | p->y;..|..pWalk-|
|00001aa0| 3e 63 75 72 72 65 6e 74 | 43 6f 6e 74 6f 75 72 20 |>current|Contour |
|00001ab0| 2b 3d 20 31 3b 0d 0d 09 | 09 2f 2a 20 69 66 20 77 |+= 1;...|./* if w|
|00001ac0| 65 27 76 65 20 70 61 73 | 73 65 64 20 74 68 65 20 |e've pas|sed the |
|00001ad0| 64 65 73 69 72 65 64 20 | 63 6f 6e 74 6f 75 72 2c |desired |contour,|
|00001ae0| 20 73 74 6f 70 20 65 61 | 72 6c 79 20 2a 2f 0d 09 | stop ea|rly */..|
|00001af0| 09 09 09 0d 09 09 69 66 | 20 28 20 28 70 57 61 6c |......if| ( (pWal|
|00001b00| 6b 2d 3e 64 65 73 69 72 | 65 64 43 6f 6e 74 6f 75 |k->desir|edContou|
|00001b10| 72 20 21 3d 20 30 20 29 | 20 26 26 20 28 70 57 61 |r != 0 )| && (pWa|
|00001b20| 6c 6b 2d 3e 63 75 72 72 | 65 6e 74 43 6f 6e 74 6f |lk->curr|entConto|
|00001b30| 75 72 20 3e 20 70 57 61 | 6c 6b 2d 3e 64 65 73 69 |ur > pWa|lk->desi|
|00001b40| 72 65 64 43 6f 6e 74 6f | 75 72 29 20 29 0d 09 09 |redConto|ur) )...|
|00001b50| 09 72 65 74 75 72 6e 28 | 74 72 75 65 29 3b 0d 09 |.return(|true);..|
|00001b60| 09 65 6c 73 65 09 09 09 | 09 0d 09 09 09 72 65 74 |.else...|.....ret|
|00001b70| 75 72 6e 28 66 61 6c 73 | 65 29 3b 0d 09 7d 0d 0d |urn(fals|e);..}..|
|00001b80| 0d 0d 42 6f 6f 6c 65 61 | 6e 09 53 68 61 70 65 4c |..Boolea|n.ShapeL|
|00001b90| 65 6e 4c 69 6e 65 74 6f | 28 67 78 50 6f 69 6e 74 |enLineto|(gxPoint|
|00001ba0| 20 2a 70 2c 20 54 53 68 | 61 70 65 4c 65 6e 52 65 | *p, TSh|apeLenRe|
|00001bb0| 63 2a 20 70 57 61 6c 6b | 29 3b 0d 42 6f 6f 6c 65 |c* pWalk|);.Boole|
|00001bc0| 61 6e 09 53 68 61 70 65 | 4c 65 6e 4c 69 6e 65 74 |an.Shape|LenLinet|
|00001bd0| 6f 28 67 78 50 6f 69 6e | 74 20 2a 70 2c 20 54 53 |o(gxPoin|t *p, TS|
|00001be0| 68 61 70 65 4c 65 6e 52 | 65 63 2a 20 70 57 61 6c |hapeLenR|ec* pWal|
|00001bf0| 6b 29 0d 09 7b 0d 09 09 | 67 78 4c 69 6e 65 09 09 |k)..{...|gxLine..|
|00001c00| 09 61 4c 69 6e 65 3b 0d | 09 09 64 6f 75 62 6c 65 |.aLine;.|..double|
|00001c10| 09 09 09 73 65 67 6d 65 | 6e 74 4c 65 6e 67 74 68 |...segme|ntLength|
|00001c20| 3b 0d 0d 09 09 61 4c 69 | 6e 65 2e 66 69 72 73 74 |;....aLi|ne.first|
|00001c30| 2e 78 20 3d 20 70 57 61 | 6c 6b 2d 3e 63 75 72 72 |.x = pWa|lk->curr|
|00001c40| 65 6e 74 50 6f 69 6e 74 | 2e 78 3b 0d 09 09 61 4c |entPoint|.x;...aL|
|00001c50| 69 6e 65 2e 66 69 72 73 | 74 2e 79 20 3d 20 70 57 |ine.firs|t.y = pW|
|00001c60| 61 6c 6b 2d 3e 63 75 72 | 72 65 6e 74 50 6f 69 6e |alk->cur|rentPoin|
|00001c70| 74 2e 79 3b 0d 09 09 61 | 4c 69 6e 65 2e 6c 61 73 |t.y;...a|Line.las|
|00001c80| 74 2e 78 20 3d 20 70 2d | 3e 78 3b 0d 09 09 61 4c |t.x = p-|>x;...aL|
|00001c90| 69 6e 65 2e 6c 61 73 74 | 2e 79 20 3d 20 70 2d 3e |ine.last|.y = p->|
|00001ca0| 79 3b 0d 09 09 0d 09 09 | 70 57 61 6c 6b 2d 3e 63 |y;......|pWalk->c|
|00001cb0| 75 72 72 65 6e 74 50 6f | 69 6e 74 2e 78 20 3d 20 |urrentPo|int.x = |
|00001cc0| 70 2d 3e 78 3b 0d 09 09 | 70 57 61 6c 6b 2d 3e 63 |p->x;...|pWalk->c|
|00001cd0| 75 72 72 65 6e 74 50 6f | 69 6e 74 2e 79 20 3d 20 |urrentPo|int.y = |
|00001ce0| 70 2d 3e 79 3b 0d 09 09 | 09 09 0d 09 09 69 66 20 |p->y;...|.....if |
|00001cf0| 28 20 28 70 57 61 6c 6b | 2d 3e 64 65 73 69 72 65 |( (pWalk|->desire|
|00001d00| 64 43 6f 6e 74 6f 75 72 | 20 3d 3d 20 30 29 20 7c |dContour| == 0) ||
|00001d10| 7c 20 28 70 57 61 6c 6b | 2d 3e 63 75 72 72 65 6e || (pWalk|->curren|
|00001d20| 74 43 6f 6e 74 6f 75 72 | 20 3d 3d 20 70 57 61 6c |tContour| == pWal|
|00001d30| 6b 2d 3e 64 65 73 69 72 | 65 64 43 6f 6e 74 6f 75 |k->desir|edContou|
|00001d40| 72 29 20 20 29 20 7b 0d | 09 09 0d 09 09 09 73 65 |r) ) {.|......se|
|00001d50| 67 6d 65 6e 74 4c 65 6e | 67 74 68 20 3d 20 47 65 |gmentLen|gth = Ge|
|00001d60| 74 4c 69 6e 65 4c 65 6e | 67 74 68 28 26 61 4c 69 |tLineLen|gth(&aLi|
|00001d70| 6e 65 29 3b 0d 09 09 09 | 09 09 09 0d 09 09 09 70 |ne);....|.......p|
|00001d80| 57 61 6c 6b 2d 3e 63 75 | 72 72 65 6e 74 4c 65 6e |Walk->cu|rrentLen|
|00001d90| 67 74 68 20 2b 3d 20 73 | 65 67 6d 65 6e 74 4c 65 |gth += s|egmentLe|
|00001da0| 6e 67 74 68 3b 0d 09 09 | 09 09 09 09 09 09 09 0d |ngth;...|........|
|00001db0| 09 09 7d 2f 2f 65 6e 64 | 20 69 66 0d 09 09 09 09 |..}//end| if.....|
|00001dc0| 0d 09 09 72 65 74 75 72 | 6e 28 66 61 6c 73 65 29 |...retur|n(false)|
|00001dd0| 3b 0d 09 7d 0d 0d 0d 0d | 42 6f 6f 6c 65 61 6e 09 |;..}....|Boolean.|
|00001de0| 53 68 61 70 65 4c 65 6e | 43 75 72 76 65 74 6f 28 |ShapeLen|Curveto(|
|00001df0| 67 78 50 6f 69 6e 74 20 | 70 5b 33 5d 2c 20 54 53 |gxPoint |p[3], TS|
|00001e00| 68 61 70 65 4c 65 6e 52 | 65 63 2a 20 70 57 61 6c |hapeLenR|ec* pWal|
|00001e10| 6b 29 3b 0d 42 6f 6f 6c | 65 61 6e 09 53 68 61 70 |k);.Bool|ean.Shap|
|00001e20| 65 4c 65 6e 43 75 72 76 | 65 74 6f 28 67 78 50 6f |eLenCurv|eto(gxPo|
|00001e30| 69 6e 74 20 70 5b 33 5d | 2c 20 54 53 68 61 70 65 |int p[3]|, TShape|
|00001e40| 4c 65 6e 52 65 63 2a 20 | 70 57 61 6c 6b 29 0d 09 |LenRec* |pWalk)..|
|00001e50| 7b 0d 09 09 67 78 43 75 | 72 76 65 09 09 61 43 75 |{...gxCu|rve..aCu|
|00001e60| 72 76 65 3b 0d 09 09 64 | 6f 75 62 6c 65 09 09 73 |rve;...d|ouble..s|
|00001e70| 65 67 6d 65 6e 74 4c 65 | 6e 67 74 68 3b 0d 0d 09 |egmentLe|ngth;...|
|00001e80| 09 61 43 75 72 76 65 2e | 66 69 72 73 74 2e 78 20 |.aCurve.|first.x |
|00001e90| 3d 20 70 5b 30 5d 2e 78 | 3b 0d 09 09 61 43 75 72 |= p[0].x|;...aCur|
|00001ea0| 76 65 2e 66 69 72 73 74 | 2e 79 20 3d 20 70 5b 30 |ve.first|.y = p[0|
|00001eb0| 5d 2e 79 3b 0d 09 09 61 | 43 75 72 76 65 2e 63 6f |].y;...a|Curve.co|
|00001ec0| 6e 74 72 6f 6c 2e 78 20 | 3d 20 70 5b 31 5d 2e 78 |ntrol.x |= p[1].x|
|00001ed0| 3b 0d 09 09 61 43 75 72 | 76 65 2e 63 6f 6e 74 72 |;...aCur|ve.contr|
|00001ee0| 6f 6c 2e 79 20 3d 20 70 | 5b 31 5d 2e 79 3b 0d 09 |ol.y = p|[1].y;..|
|00001ef0| 09 61 43 75 72 76 65 2e | 6c 61 73 74 2e 78 20 3d |.aCurve.|last.x =|
|00001f00| 20 70 5b 32 5d 2e 78 3b | 0d 09 09 61 43 75 72 76 | p[2].x;|...aCurv|
|00001f10| 65 2e 6c 61 73 74 2e 79 | 20 3d 20 70 5b 32 5d 2e |e.last.y| = p[2].|
|00001f20| 79 3b 0d 09 09 0d 09 09 | 70 57 61 6c 6b 2d 3e 63 |y;......|pWalk->c|
|00001f30| 75 72 72 65 6e 74 50 6f | 69 6e 74 2e 78 20 3d 20 |urrentPo|int.x = |
|00001f40| 70 5b 32 5d 2e 78 3b 0d | 09 09 70 57 61 6c 6b 2d |p[2].x;.|..pWalk-|
|00001f50| 3e 63 75 72 72 65 6e 74 | 50 6f 69 6e 74 2e 79 20 |>current|Point.y |
|00001f60| 3d 20 70 5b 32 5d 2e 79 | 3b 0d 09 09 09 09 0d 09 |= p[2].y|;.......|
|00001f70| 09 69 66 20 28 20 28 70 | 57 61 6c 6b 2d 3e 64 65 |.if ( (p|Walk->de|
|00001f80| 73 69 72 65 64 43 6f 6e | 74 6f 75 72 20 3d 3d 20 |siredCon|tour == |
|00001f90| 30 29 20 7c 7c 20 28 70 | 57 61 6c 6b 2d 3e 63 75 |0) || (p|Walk->cu|
|00001fa0| 72 72 65 6e 74 43 6f 6e | 74 6f 75 72 20 3d 3d 20 |rrentCon|tour == |
|00001fb0| 70 57 61 6c 6b 2d 3e 64 | 65 73 69 72 65 64 43 6f |pWalk->d|esiredCo|
|00001fc0| 6e 74 6f 75 72 29 20 20 | 29 20 7b 0d 09 09 0d 09 |ntour) |) {.....|
|00001fd0| 09 09 73 65 67 6d 65 6e | 74 4c 65 6e 67 74 68 20 |..segmen|tLength |
|00001fe0| 3d 20 47 65 74 43 75 72 | 76 65 4c 65 6e 67 74 68 |= GetCur|veLength|
|00001ff0| 28 26 61 43 75 72 76 65 | 29 3b 0d 09 09 09 0d 09 |(&aCurve|);......|
|00002000| 09 09 70 57 61 6c 6b 2d | 3e 63 75 72 72 65 6e 74 |..pWalk-|>current|
|00002010| 4c 65 6e 67 74 68 20 2b | 3d 20 73 65 67 6d 65 6e |Length +|= segmen|
|00002020| 74 4c 65 6e 67 74 68 3b | 0d 09 09 09 09 09 09 09 |tLength;|........|
|00002030| 09 09 0d 09 09 7d 2f 2f | 65 6e 64 20 69 66 0d 0d |.....}//|end if..|
|00002040| 09 09 72 65 74 75 72 6e | 28 66 61 6c 73 65 29 3b |..return|(false);|
|00002050| 0d 09 7d 0d 0d 0d 0d 42 | 6f 6f 6c 65 61 6e 20 53 |..}....B|oolean S|
|00002060| 68 61 70 65 4c 65 6e 43 | 6c 6f 73 65 70 61 74 68 |hapeLenC|losepath|
|00002070| 28 20 54 53 68 61 70 65 | 4c 65 6e 52 65 63 2a 20 |( TShape|LenRec* |
|00002080| 70 57 61 6c 6b 29 3b 0d | 42 6f 6f 6c 65 61 6e 20 |pWalk);.|Boolean |
|00002090| 53 68 61 70 65 4c 65 6e | 43 6c 6f 73 65 70 61 74 |ShapeLen|Closepat|
|000020a0| 68 28 20 54 53 68 61 70 | 65 4c 65 6e 52 65 63 2a |h( TShap|eLenRec*|
|000020b0| 20 70 57 61 6c 6b 29 0d | 09 7b 0d 09 09 67 78 4c | pWalk).|.{...gxL|
|000020c0| 69 6e 65 09 09 09 61 4c | 69 6e 65 3b 0d 09 09 64 |ine...aL|ine;...d|
|000020d0| 6f 75 62 6c 65 09 09 09 | 73 65 67 6d 65 6e 74 4c |ouble...|segmentL|
|000020e0| 65 6e 67 74 68 3b 0d 09 | 09 0d 09 09 61 4c 69 6e |ength;..|....aLin|
|000020f0| 65 2e 66 69 72 73 74 2e | 78 20 3d 20 70 57 61 6c |e.first.|x = pWal|
|00002100| 6b 2d 3e 63 75 72 72 65 | 6e 74 50 6f 69 6e 74 2e |k->curre|ntPoint.|
|00002110| 78 3b 0d 09 09 61 4c 69 | 6e 65 2e 66 69 72 73 74 |x;...aLi|ne.first|
|00002120| 2e 79 20 3d 20 70 57 61 | 6c 6b 2d 3e 63 75 72 72 |.y = pWa|lk->curr|
|00002130| 65 6e 74 50 6f 69 6e 74 | 2e 79 3b 0d 09 09 61 4c |entPoint|.y;...aL|
|00002140| 69 6e 65 2e 6c 61 73 74 | 2e 78 20 3d 20 70 57 61 |ine.last|.x = pWa|
|00002150| 6c 6b 2d 3e 66 69 72 73 | 74 50 6f 69 6e 74 2e 78 |lk->firs|tPoint.x|
|00002160| 3b 0d 09 09 61 4c 69 6e | 65 2e 6c 61 73 74 2e 79 |;...aLin|e.last.y|
|00002170| 20 3d 20 70 57 61 6c 6b | 2d 3e 66 69 72 73 74 50 | = pWalk|->firstP|
|00002180| 6f 69 6e 74 2e 79 3b 0d | 09 09 09 09 0d 09 09 70 |oint.y;.|.......p|
|00002190| 57 61 6c 6b 2d 3e 63 75 | 72 72 65 6e 74 50 6f 69 |Walk->cu|rrentPoi|
|000021a0| 6e 74 2e 78 20 3d 20 70 | 57 61 6c 6b 2d 3e 66 69 |nt.x = p|Walk->fi|
|000021b0| 72 73 74 50 6f 69 6e 74 | 2e 78 3b 0d 09 09 70 57 |rstPoint|.x;...pW|
|000021c0| 61 6c 6b 2d 3e 63 75 72 | 72 65 6e 74 50 6f 69 6e |alk->cur|rentPoin|
|000021d0| 74 2e 79 20 3d 20 70 57 | 61 6c 6b 2d 3e 66 69 72 |t.y = pW|alk->fir|
|000021e0| 73 74 50 6f 69 6e 74 2e | 79 3b 0d 09 09 0d 09 09 |stPoint.|y;......|
|000021f0| 69 66 20 28 20 28 70 57 | 61 6c 6b 2d 3e 64 65 73 |if ( (pW|alk->des|
|00002200| 69 72 65 64 43 6f 6e 74 | 6f 75 72 20 3d 3d 20 30 |iredCont|our == 0|
|00002210| 29 20 7c 7c 20 28 70 57 | 61 6c 6b 2d 3e 63 75 72 |) || (pW|alk->cur|
|00002220| 72 65 6e 74 43 6f 6e 74 | 6f 75 72 20 3d 3d 20 70 |rentCont|our == p|
|00002230| 57 61 6c 6b 2d 3e 64 65 | 73 69 72 65 64 43 6f 6e |Walk->de|siredCon|
|00002240| 74 6f 75 72 29 20 20 29 | 20 7b 0d 09 09 0d 09 09 |tour) )| {......|
|00002250| 09 73 65 67 6d 65 6e 74 | 4c 65 6e 67 74 68 20 3d |.segment|Length =|
|00002260| 20 47 65 74 4c 69 6e 65 | 4c 65 6e 67 74 68 28 26 | GetLine|Length(&|
|00002270| 61 4c 69 6e 65 29 3b 0d | 09 09 09 09 09 09 0d 09 |aLine);.|........|
|00002280| 09 09 70 57 61 6c 6b 2d | 3e 63 75 72 72 65 6e 74 |..pWalk-|>current|
|00002290| 4c 65 6e 67 74 68 20 2b | 3d 20 73 65 67 6d 65 6e |Length +|= segmen|
|000022a0| 74 4c 65 6e 67 74 68 3b | 0d 09 09 09 09 09 09 09 |tLength;|........|
|000022b0| 09 09 0d 09 09 7d 2f 2f | 65 6e 64 20 69 66 0d 0d |.....}//|end if..|
|000022c0| 09 09 72 65 74 75 72 6e | 28 66 61 6c 73 65 29 3b |..return|(false);|
|000022d0| 0d 09 7d 0d 0d 0d 0d 0d | 0d 2f 2a 2a 2a 2a 2a 2a |..}.....|./******|
|000022e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000022f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002300| 2a 2a 2a 0d 0d 09 52 6f | 75 74 69 6e 65 3a 20 41 |***...Ro|utine: A|
|00002310| 63 63 75 72 61 74 65 47 | 65 74 53 68 61 70 65 4c |ccurateG|etShapeL|
|00002320| 65 6e 67 74 68 2e 0d 09 | 0d 09 52 65 70 6c 61 63 |ength...|..Replac|
|00002330| 65 6d 65 6e 74 20 66 6f | 72 20 47 58 47 65 74 53 |ement fo|r GXGetS|
|00002340| 68 61 70 65 4c 65 6e 67 | 74 68 2e 0d 09 0d 2a 2a |hapeLeng|th....**|
|00002350| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002360| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002370| 2a 2a 2a 2a 2a 2a 2a 2a | 2f 0d 0d 77 69 64 65 2a |********|/..wide*|
|00002380| 20 41 63 63 75 72 61 74 | 65 47 65 74 53 68 61 70 | Accurat|eGetShap|
|00002390| 65 4c 65 6e 67 74 68 28 | 67 78 53 68 61 70 65 20 |eLength(|gxShape |
|000023a0| 74 61 72 67 65 74 2c 20 | 6c 6f 6e 67 20 69 6e 64 |target, |long ind|
|000023b0| 65 78 2c 20 77 69 64 65 | 20 2a 77 69 64 65 4c 65 |ex, wide| *wideLe|
|000023c0| 6e 67 74 68 29 0d 09 7b | 0d 09 09 42 6f 6f 6c 65 |ngth)..{|...Boole|
|000023d0| 61 6e 09 09 09 09 09 73 | 74 6f 70 70 65 64 45 61 |an.....s|toppedEa|
|000023e0| 72 6c 79 3b 09 0d 09 09 | 54 53 68 61 70 65 4c 65 |rly;....|TShapeLe|
|000023f0| 6e 52 65 63 09 09 73 68 | 61 70 65 4c 65 6e 52 65 |nRec..sh|apeLenRe|
|00002400| 63 3b 0d 09 09 77 69 64 | 65 09 09 09 09 09 09 2a |c;...wid|e......*|
|00002410| 72 65 73 75 6c 74 20 3d | 20 77 69 64 65 4c 65 6e |result =| wideLen|
|00002420| 67 74 68 3b 0d 09 09 0d | 09 09 2f 2a 20 69 6e 69 |gth;....|../* ini|
|00002430| 74 69 61 6c 69 7a 65 20 | 74 68 65 20 73 74 72 75 |tialize |the stru|
|00002440| 63 74 75 72 65 20 74 68 | 61 74 20 6d 61 69 6e 74 |cture th|at maint|
|00002450| 61 69 6e 73 20 6f 75 72 | 20 73 74 61 74 65 2e 20 |ains our| state. |
|00002460| 2a 2f 0d 09 09 0d 09 09 | 73 68 61 70 65 4c 65 6e |*/......|shapeLen|
|00002470| 52 65 63 2e 63 75 72 72 | 65 6e 74 43 6f 6e 74 6f |Rec.curr|entConto|
|00002480| 75 72 20 3d 20 30 3b 0d | 09 09 73 68 61 70 65 4c |ur = 0;.|..shapeL|
|00002490| 65 6e 52 65 63 2e 64 65 | 73 69 72 65 64 43 6f 6e |enRec.de|siredCon|
|000024a0| 74 6f 75 72 20 3d 20 69 | 6e 64 65 78 3b 0d 09 09 |tour = i|ndex;...|
|000024b0| 73 68 61 70 65 4c 65 6e | 52 65 63 2e 63 75 72 72 |shapeLen|Rec.curr|
|000024c0| 65 6e 74 4c 65 6e 67 74 | 68 20 3d 20 30 2e 30 3b |entLengt|h = 0.0;|
|000024d0| 0d 0d 09 09 2f 2a 20 4e | 6f 77 20 77 61 6c 6b 20 |..../* N|ow walk |
|000024e0| 74 68 65 20 73 68 61 70 | 65 20 75 73 69 6e 67 20 |the shap|e using |
|000024f0| 6f 75 72 20 73 68 61 70 | 65 20 6c 65 6e 67 74 68 |our shap|e length|
|00002500| 20 63 61 6c 63 75 6c 61 | 74 69 6f 6e 20 63 61 6c | calcula|tion cal|
|00002510| 6c 62 61 63 6b 73 2e 20 | 2a 2f 0d 09 09 09 09 0d |lbacks. |*/......|
|00002520| 09 09 73 74 6f 70 70 65 | 64 45 61 72 6c 79 20 3d |..stoppe|dEarly =|
|00002530| 20 53 68 61 70 65 57 61 | 6c 6b 65 72 28 74 61 72 | ShapeWa|lker(tar|
|00002540| 67 65 74 2c 20 53 68 61 | 70 65 4c 65 6e 4d 6f 76 |get, Sha|peLenMov|
|00002550| 65 74 6f 2c 20 53 68 61 | 70 65 4c 65 6e 4c 69 6e |eto, Sha|peLenLin|
|00002560| 65 74 6f 2c 20 53 68 61 | 70 65 4c 65 6e 43 75 72 |eto, Sha|peLenCur|
|00002570| 76 65 74 6f 2c 20 53 68 | 61 70 65 4c 65 6e 43 6c |veto, Sh|apeLenCl|
|00002580| 6f 73 65 70 61 74 68 2c | 20 26 73 68 61 70 65 4c |osepath,| &shapeL|
|00002590| 65 6e 52 65 63 29 3b 0d | 09 09 09 0d 09 09 2f 2a |enRec);.|....../*|
|000025a0| 20 4d 61 6b 65 20 61 20 | 77 69 64 65 20 6e 75 6d | Make a |wide num|
|000025b0| 62 65 72 20 6f 75 74 20 | 6f 66 20 74 68 65 20 72 |ber out |of the r|
|000025c0| 65 73 75 6c 74 69 6e 67 | 20 6c 65 6e 67 74 68 20 |esulting| length |
|000025d0| 77 68 69 63 68 20 69 73 | 20 61 20 64 6f 75 62 6c |which is| a doubl|
|000025e0| 65 20 2a 2f 0d 0d 09 09 | 69 66 20 28 20 28 73 68 |e */....|if ( (sh|
|000025f0| 61 70 65 4c 65 6e 52 65 | 63 2e 63 75 72 72 65 6e |apeLenRe|c.curren|
|00002600| 74 4c 65 6e 67 74 68 20 | 3c 20 33 32 37 36 37 2e |tLength |< 32767.|
|00002610| 39 39 39 39 29 20 26 26 | 20 28 73 68 61 70 65 4c |9999) &&| (shapeL|
|00002620| 65 6e 52 65 63 2e 63 75 | 72 72 65 6e 74 4c 65 6e |enRec.cu|rrentLen|
|00002630| 67 74 68 20 3e 20 2d 33 | 32 37 36 38 2e 39 39 39 |gth > -3|2768.999|
|00002640| 39 29 29 20 7b 0d 09 09 | 0d 09 09 09 64 6f 75 62 |9)) {...|....doub|
|00002650| 6c 65 09 09 09 6c 6f 50 | 61 72 74 2c 20 68 69 50 |le...loP|art, hiP|
|00002660| 61 72 74 3b 0d 0d 09 09 | 09 6c 6f 50 61 72 74 20 |art;....|.loPart |
|00002670| 3d 20 73 68 61 70 65 4c | 65 6e 52 65 63 2e 63 75 |= shapeL|enRec.cu|
|00002680| 72 72 65 6e 74 4c 65 6e | 67 74 68 3b 0d 09 09 09 |rrentLen|gth;....|
|00002690| 0d 09 09 09 2f 2f 20 73 | 69 67 6e 20 65 78 74 65 |....// s|ign exte|
|000026a0| 6e 64 20 74 68 65 20 6c | 6f 20 70 61 72 74 20 69 |nd the l|o part i|
|000026b0| 6e 74 6f 20 74 68 65 20 | 68 69 67 68 20 70 61 72 |nto the |high par|
|000026c0| 74 2e 0d 09 09 09 69 66 | 20 28 6c 6f 50 61 72 74 |t.....if| (loPart|
|000026d0| 20 3e 20 30 29 0d 09 09 | 09 09 68 69 50 61 72 74 | > 0)...|..hiPart|
|000026e0| 20 3d 20 30 2e 30 3b 0d | 09 09 09 65 6c 73 65 0d | = 0.0;.|...else.|
|000026f0| 09 09 09 09 68 69 50 61 | 72 74 20 3d 20 2d 31 2e |....hiPa|rt = -1.|
|00002700| 30 3b 0d 09 09 0d 09 09 | 09 72 65 73 75 6c 74 2d |0;......|.result-|
|00002710| 3e 6c 6f 20 3d 20 44 6f | 75 62 6c 65 54 6f 46 69 |>lo = Do|ubleToFi|
|00002720| 78 65 64 28 6c 6f 50 61 | 72 74 29 3b 0d 09 09 09 |xed(loPa|rt);....|
|00002730| 72 65 73 75 6c 74 2d 3e | 68 69 20 3d 20 28 6c 6f |result->|hi = (lo|
|00002740| 6e 67 29 68 69 50 61 72 | 74 3b 0d 09 09 09 0d 09 |ng)hiPar|t;......|
|00002750| 09 7d 20 65 6c 73 65 20 | 7b 20 0d 09 09 0d 09 09 |.} else |{ ......|
|00002760| 09 44 65 62 75 67 53 74 | 72 28 22 5c 70 49 20 64 |.DebugSt|r("\pI d|
|00002770| 6f 6e 27 74 20 6b 6e 6f | 77 20 68 6f 77 20 74 6f |on't kno|w how to|
|00002780| 20 63 6f 6e 76 65 72 74 | 20 61 20 62 69 67 20 6e | convert| a big n|
|00002790| 75 6d 62 65 72 20 74 6f | 20 61 20 77 69 64 65 20 |umber to| a wide |
|000027a0| 22 29 3b 0d 09 09 09 0d | 09 09 7d 2f 2f 65 6e 64 |");.....|..}//end|
|000027b0| 20 69 66 0d 09 09 0d 0d | 09 09 72 65 74 75 72 6e | if.....|..return|
|000027c0| 28 72 65 73 75 6c 74 29 | 3b 0d 09 0d 09 7d 2f 2f |(result)|;....}//|
|000027d0| 41 63 63 75 72 61 74 65 | 47 65 74 53 68 61 70 65 |Accurate|GetShape|
|000027e0| 4c 65 6e 67 74 68 0d 0d | 00 00 00 00 00 00 00 00 |Length..|........|
|000027f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002800| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00002810| 00 00 00 00 00 00 00 00 | 00 00 00 03 00 00 0a e1 |........|........|
|00002820| ac a7 ea db 13 43 6f 64 | 65 57 61 72 72 69 6f 72 |.....Cod|eWarrior|
|00002830| 12 53 68 61 70 65 4d 65 | 61 73 75 72 65 6d 65 6e |.ShapeMe|asuremen|
|00002840| 74 2e 63 6d 02 00 00 00 | 54 45 58 54 43 57 49 45 |t.cm....|TEXTCWIE|
|00002850| 00 00 54 45 58 54 43 57 | 49 45 01 00 ff ff ff ff |..TEXTCW|IE......|
|00002860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002870| 00 00 ad 99 22 88 00 00 | 27 68 00 00 01 9a 6c 61 |...."...|'h....la|
|00002880| 72 69 73 44 72 61 77 00 | 00 00 00 00 00 00 00 00 |risDraw.|........|
|00002890| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 01 |........|........|
|000028a0| 00 00 2a 7a ac a8 42 9f | 0e 54 79 70 65 20 31 20 |..*z..B.|.Type 1 |
|000028b0| 45 6e 61 62 6c 65 72 00 | 00 00 00 00 00 00 00 00 |Enabler.|........|
|000028c0| 00 00 00 00 00 00 00 00 | 00 00 00 01 00 00 50 b1 |........|......P.|
|000028d0| ac a9 20 f5 06 46 69 6e | 64 65 72 00 00 00 00 00 |.. ..Fin|der.....|
|000028e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028f0| 00 00 00 00 00 00 00 01 | 00 00 00 02 ac aa cd 48 |........|.......H|
|00002900| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00002910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002920| 00 00 00 00 00 00 00 03 | 00 02 00 58 00 02 01 db |........|...X....|
|00002930| 02 7e 00 58 00 02 01 db | 02 7e ae 77 1a 08 00 00 |.~.X....|.~.w....|
|00002940| 26 7d 00 00 26 7d 00 00 | 24 51 01 00 00 00 00 04 |&}..&}..|$Q......|
|00002950| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00002960| 00 00 00 46 01 81 84 28 | 22 e4 00 00 00 1c 00 46 |...F...(|"......F|
|00002970| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00002980| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00002990| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|000029a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+